package com.ljxy.score.controller.myController;


import com.ljxy.score.common.Result;
import com.ljxy.score.entity.domain.TeacherRegister;
import com.ljxy.score.service.myteacherService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@RequestMapping("/my_teacher")
public class MyTeacherController {

    @Resource
    private myteacherService myteacherService;

    @PostMapping("/register")
    public Result<?> register(@RequestBody TeacherRegister userRegister) {
        return myteacherService.register(userRegister.getPhone(), userRegister.getPassword());
    }


    @PostMapping("/login")
    public Result<?> login(@RequestBody TeacherRegister userRegister
                        ) {
        return myteacherService.login(userRegister.getPhone(), userRegister.getPassword());
    }
}
